package com.ez.supervise.model.base;

import java.io.Serializable;
import java.util.Date;

public class BaseEntity implements Serializable {
    private static final long serialVersionUID = 8315754389478057939L;

    protected Long id;
    protected String isDeleted;

    protected String creator;
    protected Date createTime;
    protected String modifier;
    protected Date modifyTime;

    public static final String FLAG_YES = "y";
    public static final String FLAG_NO = "n";
    public static final String SEZ_YES = "m";
    /** 性别:男 */
    public static final String FLAG_MALE = "m";
    /** 性别:女 */
    public static final String FLAG_FEMALE = "f";

    public static final String STATUS_ALIVE = "alive";// 活动
    public static final String STATUS_STOP = "stop";// 停止活动或禁用
    
    public static final String STATUS_PUBLISH_YES = "publish_yes";// 已发布
    public static final String STATUS_PUBLISH_NO = "publish_no";// 未发布

    public BaseEntity() {
	id = 0L;
	isDeleted = FLAG_NO;
	createTime = new Date();
	modifyTime = new Date();
	creator = "";
	modifier = "";
    }

    public Date getCreateTime() {
	return createTime;
    }

    public String getCreator() {
	return creator;
    }

    public Long getId() {
	return id;
    }

    public String getIsDeleted() {
	return isDeleted;
    }

    public void setIsDeleted(String isDeleted) {
	this.isDeleted = isDeleted;
    }

    public String getModifier() {
	return modifier;
    }

    public Date getModifyTime() {
	return modifyTime;
    }

    public void setCreateTime(Date createTime) {
	this.createTime = createTime;
    }

    public void setCreator(String creator) {
	this.creator = creator;
    }

    public void setId(Long id) {
	this.id = id;
    }

    public void setModifier(String modifier) {
	this.modifier = modifier;
    }

    public void setModifyTime(Date modifyTime) {
	this.modifyTime = modifyTime;
    }

    /**
     * 判断对象是否删除
     * 
     * @return
     */
    public boolean isDeleted() {
	return FLAG_YES.equals(isDeleted);
    }

    /**
     * 判断对象是否是新建的对象
     * 
     * @return
     */
    public boolean isNew() {
	return id == null || id == 0L;
    }
}
